Skip to content

Conversation

Muscraft
Copy link
Member

While comparing the Unicode theme output of rustc and annotate-snippets, I found that rustc would "close the window" (draw a ╰╴), even though there were other annotated files that followed the current one. This PR makes it so the emitter will only "close the window" on the last annotated file.

Before:

error[E0624]: method `method` is private
   ╭▸ $DIR/close_window.rs:9:7
   │
LL │     s.method();
   ╰╴      ━━━━━━ private method
   │
   ⸬ $DIR/auxiliary/close_window.rs:3:5
   │
LL │     fn method(&self) {}
   ╰╴    ──────────────── private method defined here

After:

error[E0624]: method `method` is private
   ╭▸ $DIR/close_window.rs:9:7
   │
LL │     s.method();
   │       ━━━━━━ private method
   │
   ⸬ $DIR/auxiliary/close_window.rs:3:5
   │
LL │     fn method(&self) {}
   ╰╴    ──────────────── private method defined here

@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 29, 2025
@Muscraft Muscraft force-pushed the fix-unicode-close-window branch from 7ea60df to 0c099b0 Compare July 30, 2025 22:25
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 31, 2025
@Muscraft Muscraft force-pushed the fix-unicode-close-window branch from 0c099b0 to 761c4e3 Compare July 31, 2025 06:25
@fee1-dead
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 31, 2025

📌 Commit 761c4e3 has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 31, 2025
bors added a commit that referenced this pull request Jul 31, 2025
Rollup of 3 pull requests

Successful merges:

 - #144657 (fix: Only "close the window" when its the last annotated file)
 - #144665 (Re-block SRoA on SIMD types)
 - #144713 (`rustc_middle::ty` cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 880113e into rust-lang:master Jul 31, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 31, 2025
rust-timer added a commit that referenced this pull request Jul 31, 2025
Rollup merge of #144657 - Muscraft:fix-unicode-close-window, r=fee1-dead

fix: Only "close the window" when its the last annotated file

While comparing the Unicode theme output of `rustc` and `annotate-snippets`, I found that `rustc` would ["close the window"](https://github.com/rust-lang/rust/blob/686bc1c5f9c06762b18082434c04d514acf6707e/compiler/rustc_errors/src/emitter.rs#L1025-L1027) (draw a `╰╴`), even though there were other annotated files that followed the current one. This PR makes it so the emitter will only "close the window" on the last annotated file.

Before:
```
error[E0624]: method `method` is private
   ╭▸ $DIR/close_window.rs:9:7
   │
LL │     s.method();
   ╰╴      ━━━━━━ private method
   │
   ⸬ $DIR/auxiliary/close_window.rs:3:5
   │
LL │     fn method(&self) {}
   ╰╴    ──────────────── private method defined here
```

After:
```
error[E0624]: method `method` is private
   ╭▸ $DIR/close_window.rs:9:7
   │
LL │     s.method();
   │       ━━━━━━ private method
   │
   ⸬ $DIR/auxiliary/close_window.rs:3:5
   │
LL │     fn method(&self) {}
   ╰╴    ──────────────── private method defined here
```
@Muscraft Muscraft deleted the fix-unicode-close-window branch July 31, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants